package com.zc.demo.aop;

import com.zc.demo.di.interfaces.Performer;
import com.zc.demo.util.BaseTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

/**
 * Created by zhangchi9 on 2016/11/4.
 */
public class ExecutionAop extends BaseTest{
    @Autowired
    @Qualifier("aopPerformer")
    private Performer performer;

    @Test
    public void test() throws Exception{
        performer.perform();
    }

    @Autowired
    private Thinker thinker;
    @Autowired
    @Qualifier("Magician")
    private MindReader mindReader;
    @Test
    public void magicianShouldReadVolunteersMind(){
        thinker.thinkOfSomething("想打篮球");
        System.out.println(mindReader.getThoughts());
    }
}
